﻿using System;
using System.Reflection;

namespace Davian.Model
{
    class AssemblyInfo
    {
        // Assembly Information : Product
        public String AssemblyProduct
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
                if (attributes.Length > 0)
                {
                    AssemblyProductAttribute objAttribute = (AssemblyProductAttribute)attributes[0];
                    if (!objAttribute.Product.Equals(String.Empty))
                        return objAttribute.Product;
                }
                return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
            }
        }  
    }
}
